import { createStore } from 'vuex';

export default createStore({
    state: {
        isAuthenticated: false,
    },
    mutations: {
        setAuth(state, status) {
            state.isAuthenticated = status;
        },
    },
    actions: {
        login({ commit }, password) {
            // 这里调用API进行登录验证
            if (password === '123456') {
                commit('setAuth', true);
                return true;
            } else {
                return false;
            }
        },
    },
});